import React from 'react';
import { BaseIcon, type BaseIconProps } from '../base-icon';

export type IconProps = Omit<BaseIconProps, 'children'>;

/**
 * 包装一个 SVG 组件为 Icon 组件
 * @param Svg
 * @returns
 */
export function wrapSvgComponent(Svg: React.ComponentType) {
  const Icon = (props: IconProps) => {
    return (
      <BaseIcon {...props}>
        {/* {createElement(Svg)} */}
        <Svg></Svg>
      </BaseIcon>
    );
  };

  return Icon;
}
